package com.docMan.utils;

public class FileTypeUtil {

	public static final String file_pdf = "pdf";
	public static final String file_word = "word";
	public static final String file_excel = "excel";
	public static final String file_tif = "tif";
	public static final String file_unknow = "unknow";

	public static String fileType(String fileName) {
		String type = fileName.substring(fileName.lastIndexOf(".") + 1,
				fileName.length());
		switch (type) {
		case "xls":
			return file_excel;
		case "xlsx":
			return file_excel;
		case "doc":
			return file_word;
		case "docx":
			return file_word;
		case "tif":
			return file_tif;
		case "tiff":
			return file_tif;
		case "pdf":
			return file_pdf;
		default:
			return file_unknow;
		}
	}

}
